﻿using System.ComponentModel.DataAnnotations;
using Abp.Domain.Entities;
using JetBrains.Annotations;

namespace DHJ.Cost.Tasks
{
    /// <summary>
    ///     型号任务，Id为任务号
    /// </summary>
    public sealed class Task : Entity<long>
    {
        [UsedImplicitly]
        private Task()
        {
        }

        public Task(
            string sysId,
            string taskNum,
            string modelId,
            string productId,
            string productName,
            int plannedQuantity,
            int productionQuantity)
        {
            SysId = sysId;
            TaskNum = taskNum;
            ModelId = modelId;
            ProductId = productId;
            ProductName = productName;
            PlannedQuantity = plannedQuantity;
            ProductionQuantity = productionQuantity;
        }

        /// <summary>
        ///     条码系统的Id
        /// </summary>
        public string SysId { get; set; }

        /// <summary>
        ///     任务号
        /// </summary>
        [Required]
        public string TaskNum { get; set; }

        /// <summary>
        ///     型号
        /// </summary>
        [Required]
        public string ModelId { get; set; }

        /// <summary>
        ///     产品图号
        /// </summary>
        [Required]
        public string ProductId { get; set; }

        /// <summary>
        ///     产品名称
        /// </summary>
        [Required]
        public string ProductName { get; set; }

        /// <summary>
        ///     计划数量
        /// </summary>
        public int PlannedQuantity { get; set; }

        /// <summary>
        ///     投入数量
        /// </summary>
        public int ProductionQuantity { get; set; }
    }
}